<template>
  <div class="node-panel">
    <!-- 拖拽节点类型 -->
    <div v-for="type in nodeTypes" draggable @dragstart="onDragStart(type)">
      {{ type }}
    </div>
  </div>
  <div class="canvas" @drop="onDrop" @dragover.prevent>
    <!-- 渲染节点 -->
    <Node v-for="node in nodes" :node="node" @move="onNodeMove" @config="onNodeConfig"/>
    <!-- 渲染连线 -->
    <svg class="lines">
      <Line v-for="line in lines" :line="line" :nodes="nodes"/>
    </svg>
  </div>
  <NodeConfig v-if="showConfig" :node="currentNode" @save="onConfigSave"/>
</template>
